package com.itheima.aop;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

/**
 * @Author：cxl
 * @Package：com.itheima.aop
 * @Project：web-project
 * @name：MyAspect6
 * @Date：2025/10/7 11:51
 * @Filename：MyAspect6
 */
@Slf4j
@Aspect
//@Component
public class MyAspect6 {
    @Around("execution(* com.itheima.controller.*.add*(..)) ||" +
            "execution(* com.itheima.controller.*.delete*(..)) ||" +
            "execution(* com.itheima.controller.*.update*(..))"
    )
    public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
        log.info("MyLog注解生效：环绕通知开始");
        Object result = joinPoint.proceed();
        log.info("MyLog注解生效：环绕通知结束");
        return result;
    }
}
